#ifndef SYSTEMSETTINGSPAGE_H
#define SYSTEMSETTINGSPAGE_H

#include "ems_summary.h"

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGroupBox>
#include <QFormLayout>
#include <QComboBox>
#include <QCheckBox>
#include <QPushButton>
#include <QLabel>
#include <QSlider>
#include <QApplication>
#include <QPalette>
#include <QDir>

class SystemSettingsPage : public QWidget
{
    Q_OBJECT

public:
    explicit SystemSettingsPage(QWidget *parent = nullptr);
    QString debug_data_save_location;
    QString receive_data_save_location;
    QString receive_config_location;
    QString send_config_location;
    EMS_Summary *summary;
signals:
    void helpRequested();
    void themeChanged(int index);
    void settingsSaved();
    void restoreDefaultsRequested();

public slots:
    void change_alarm_volumn(int value);
    void sound_effect_check(Qt::CheckState);

protected slots:
        virtual void onExitClicked();
        virtual void onHelpClicked();
        virtual void onThemeChanged(int index);

private:
        void setupUI();
        QGroupBox* createGeneralSettingsGroup();

        QGroupBox* createAppearanceGroup();

        QGroupBox* createSoundSettingsGroup();
        QGroupBox* createSerialSettingsGroup();
        QWidget* createBottomControls();

        void setupConnections();

        void applyStyling();

protected:
    // 控件成员
    QCheckBox *autoUpdateCheck;
    QCheckBox *saveHistoryCheck;
    QComboBox *themeCombo;
    QSlider *volumeSlider;
    QCheckBox *notificationCheck;


};
#endif // SYSTEMSETTINGSPAGE_H
